home *** CD-ROM | disk | FTP | other *** search
/ Amiga Developer CD 2.1 / Amiga Developer CD v2.1.iso / Reference / DevCon / Atlanta_1990 / Atlanta-Devcon.1 / Libraries / Commodities / NoCapsLock / app.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-08-26  |  7.8 KB  |  183 lines

  1.  
  2.    /***********************************************************************
  3.    *                                                                      *
  4.    *                            COPYRIGHTS                                *
  5.    *                                                                      *
  6.    *   Copyright (c) 1990  Commodore-Amiga, Inc.  All Rights Reserved.    *
  7.    *                                                                      *
  8.    ***********************************************************************/
  9.  
  10. #ifndef APP_H
  11. #define APP_H
  12.  
  13. #ifdef LATTICE
  14. #include <pragmas/gadtools_pragmas.h>
  15. #endif
  16.  
  17. #include <clib/all_protos.h>
  18.  
  19. /**********************************************************************/
  20. /* Prototypes for functions declared in app.c and called from the  */
  21. /* standard modules.                                                  */
  22. /**********************************************************************/
  23. VOID setupCustomGadgets(struct Gadget **);
  24. VOID HandleGadget(ULONG,ULONG);
  25. VOID setupCustomMenu(VOID);
  26. VOID handleCustomMenu(UWORD);
  27. VOID refreshWindow(VOID);
  28. BOOL setupCustomCX(VOID);
  29. VOID shutdownCustomCX(VOID);
  30. VOID handleCustomCXMsg(ULONG);
  31. VOID handleCustomCXCommand(ULONG);
  32. VOID handleCustomSignal(VOID);
  33.  
  34. /**********************************************************************/
  35. /* Prototypes for functions declared in the standard modules and      */
  36. /* called by app.c                                                    */
  37. /**********************************************************************/
  38. VOID setupWindow(VOID);
  39. VOID shutdownWindow(VOID);
  40. VOID terminate(VOID);
  41.  
  42. /**********************************************************************/
  43. /* Prototypes for functions declared in application modules and       */
  44. /* called by app.c                                                    */
  45. /**********************************************************************/
  46. BOOL setupNoCapsLock(VOID);
  47.  
  48. /**********************************************************************/
  49. /* definitions for global variables declared in the standard modules  */
  50. /* referenced by app.c                                                */
  51. /**********************************************************************/
  52. extern CxObj                  *broker;
  53. extern SHORT                  topborder;
  54. extern VOID                   *vi;
  55. extern struct Menu            *menu;
  56. extern struct Library         *GadToolsBase;
  57. extern struct Gadget          *glist;
  58. extern char                   **ttypes;
  59. extern struct MsgPort         *cxport;
  60. extern struct IntuitionBase   *IntuitionBase;
  61. extern BOOL                   IDCMPRefresh;
  62.  
  63. /**********************************************************************/
  64. /* definitions for global variables declared in app.c and             */
  65. /* referenced by the standard modules.                                */
  66. /**********************************************************************/
  67. extern struct TextAttr mydesiredfont;
  68.  
  69. /**********************************************************************/
  70. /* Commodities specific definitions.                                  */
  71. /*                                                                    */
  72. /* COM_NAME  - used for the scrolling display in the Exchange program */
  73. /* COM_TITLE - used for the window title bar and the long description */
  74. /*             in the Exchange program                                */
  75. /* COM_DESC  - Commodity description used by the Exchange program     */
  76. /* CX_DEFAULT_PRIORITY - default priority for this commodities broker */
  77. /*                       can be overidden by using icon TOOL TYPES    */
  78. /**********************************************************************/
  79. #define COM_NAME  "nocapslock"
  80. #define COM_TITLE "NoCapsLock"
  81. #define COM_DESCR "Renders Caps Lock Ineffective"
  82. #define CX_DEFAULT_PRIORITY 0
  83. #define CX_DEFAULT_POP_KEY ("shift f1")
  84. #define CX_DEFAULT_POP_ON_START ("YES")
  85.  
  86. /**********************************************************************/
  87. /* Custom Signal control                                              */
  88. /*                                                                    */
  89. /* If CSIGNAL = 0 then this commodity will NOT have a custom signal   */
  90. /* If CSIGNAL = 1 this commodity will support a custom signal         */
  91. /**********************************************************************/
  92. #define CSIGNAL 0
  93.  
  94. /**********************************************************************/
  95. /* Window control                                                     */
  96. /*                                                                    */
  97. /* If WINDOW = 0 then this commodity will NOT have a popup window     */
  98. /* If WINDOW = 1 this commodity will support a popup window with the  */
  99. /*               attributes defined below.                            */
  100. /**********************************************************************/
  101. #define WINDOW 0
  102.  
  103. #if WINDOW
  104. #define W(x) x
  105. #else
  106. #define W(x) ;
  107. #endif
  108.  
  109. #if WINDOW
  110.  
  111. extern struct Window   *window; /* our window */
  112. extern struct TextFont *font;
  113.  
  114. #define WINDOW_LEFT   134
  115. #define WINDOW_TOP    64
  116. #define WINDOW_WIDTH  362
  117. #define WINDOW_HEIGHT 68
  118. #define WINDOW_INNERHEIGHT 70
  119.  
  120. #define WINDOW_SIZING 0
  121. #if WINDOW_SIZING
  122. #define WINDOW_MAX_WIDTH  -1
  123. #define WINDOW_MIN_WIDTH  50
  124. #define WINDOW_MAX_HEIGHT -1
  125. #define WINDOW_MIN_HEIGHT 30
  126. #define WFLAGS (ACTIVATE | WINDOWCLOSE | WINDOWDRAG | WINDOWSIZING | WINDOWDEPTH | SIMPLE_REFRESH )
  127. #else
  128. #define WINDOW_MAX_WIDTH  WINDOW_WIDTH
  129. #define WINDOW_MIN_WIDTH  WINDOW_WIDTH
  130. #define WINDOW_MAX_HEIGHT WINDOW_HEIGHT
  131. #define WINDOW_MIN_HEIGHT WINDOW_HEIGHT
  132. #define WFLAGS (ACTIVATE | WINDOWCLOSE | WINDOWDRAG | WINDOWDEPTH | SIMPLE_REFRESH )
  133. #endif  /* WINDOW_SIZING */
  134.  
  135. #define IFLAGS (MENUPICK | MOUSEBUTTONS | GADGETUP | GADGETDOWN | MOUSEMOVE | CLOSEWINDOW | REFRESHWINDOW )
  136.  
  137.                                      /* hotkey definitions                */
  138. #define POP_KEY_ID     (86L)         /* pop up identifier                 */
  139.  
  140. /**********************************************************************/
  141. /* Gadget control                                                     */
  142. /*                                                                    */
  143. /* Here are the gadget specific definitions. Note that these are      */
  144. /* included only if WINDOW=1 since gadgets make no sense without a    */
  145. /* window.                                                            */
  146. /**********************************************************************/
  147. #define GAD_HIDE     1
  148. #define GAD_DIE      2
  149.  
  150. /**********************************************************************/
  151. /* Menu control                                                       */
  152. /*                                                                    */
  153. /* Here are the menu specific definitions. Note that these are        */
  154. /* included only if WINDOW=1 since menus make no sense without a      */
  155. /* window.                                                            */
  156. /**********************************************************************/
  157. #define MENU_HIDE     1
  158. #define MENU_DIE      2
  159.  
  160. #endif  /* WINDOW */
  161.  
  162. /**********************************************************************/
  163. /* Debug control                                                      */
  164. /*                                                                    */
  165. /* The first define converts any printfs that got in by mistake into  */
  166. /* kprintfs. If you are debuging to the console you can change        */
  167. /* kprintfs into printfs.                                             */
  168. /* The D1(x) define controls debugging in the standard modules. Use   */
  169. /* The D(x) macro for debugging in the app.c module.                  */
  170. /**********************************************************************/
  171. void kprintf(char *,...);
  172. #define printf kprintf
  173.  
  174. #ifdef DEBUG
  175. #define D1(x) x
  176. #define D(x)  x
  177. #else
  178. #define D1(x) ;
  179. #define D(x)  ;
  180. #endif /* NO DEBUG */
  181.  
  182. #endif /* APP_H */
  183.